﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebDesign.maneger
{
    public partial class ordertype : System.Web.UI.Page
    {
        SqlClass sc = new SqlClass();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                sc.BindCombobox("select * from OrderTypetbl ", "TypeId", "TypeName", ddType);
        }

        protected void btnType_Click(object sender, EventArgs e)
        {
            sc.BindGridView("select TypeName,OrderExp,OrderDatefinal,OrderingDate,CustomerName,CustomerFamily,CustomerPhone from Customertbl,Ordertbl,OrderTypetbl  where OrderTypetbl.TypeId=Ordertbl.TypeId and Ordertbl.CustomerId=Customertbl.CustomerId and TypeName=N'" + ddType.SelectedItem.Text + "'", gvOrder);
        }

        protected void btnDate_Click(object sender, EventArgs e)
        {
            sc.BindGridView("select TypeName,OrderExp,OrderDatefinal,OrderingDate,CustomerName,CustomerFamily,CustomerPhone from Customertbl,Ordertbl,OrderTypetbl where OrderTypetbl.TypeId=Ordertbl.TypeId and Ordertbl.CustomerId=Customertbl.CustomerId and OrderDatefinal='" + txtDate.Text + "'", gvOrder);
        }

       
    }
}